package cn.iocoder.yudao.module.book.dal.dataobject.books;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;

import javax.validation.constraints.PastOrPresent;

/**
 * 绘本 DO
 *
 * @author xi
 */
@TableName("books")
@KeySequence("books_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BooksDO extends BaseDO {

    /**
     * 绘本id
     */
    @TableId
    private Integer bookId;
    /**
     * 绘本集id
     */
    private Integer collectionId;
    /**
     * 标题
     */
    private String title;
    /**
     * 顺序
     */
    private Integer sort;
    /**
     * 绘本封面
     */
//    private String coverUrl;
    private String image;

    private String creator;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @PastOrPresent(message = "阅读时间不能超过当前时间")
    private LocalDateTime updateTime;

}